from rest_framework_simplejwt.serializers import TokenRefreshSerializer
from rest_framework_simplejwt.views import TokenRefreshView


class TokenRefreshSerializers(TokenRefreshSerializer):
    def validate(self, attrs):
        data = super().validate(attrs)
        result = {
            "code": 1,
            "msg": "请求成功",
            "data": data
        }
        return result


class RefreshTokenViews(TokenRefreshView):
    serializer_class = TokenRefreshSerializers
    permission_classes = []
